﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ninject;
using Meraz.Core.Repositories;
using Meraz.Core.Model;

namespace Meraz.Core.Commands
{
    public interface IGetPosterCommand
    {
        IPosterRepository PosterRepository { get; set; }
        Poster Execute(int postID, string name);
        Poster Execute(int id);

    }
    public class GetPosterCommand : BaseCommand, IGetPosterCommand
    {
        [Inject]
        public IPosterRepository PosterRepository { get; set; }

        public Poster Execute(int postID, string name)
        {
            return PosterRepository.GetByName(postID, name);
        }
        public Poster Execute(int id)
        {
            return PosterRepository.GetById(id);
        }
    }
}
